#import "JuggleAmazingController.h"
        
#import "JuggleAmazingModel.h"
#import "JuggleAmazingCell.h"
#import "Masonry.h"

@interface JuggleAmazingController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *laughGlowZealotTableView;
@property (nonatomic, strong) NSMutableArray *velvetGratitudeEchoModels;

@end

@implementation JuggleAmazingController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self onyxElevateSetuplayout];
	[self zealTerrainImaginationgetData];
}


- (void)onyxElevateSetuplayout {
    self.laughGlowZealotTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.laughGlowZealotTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    self.laughGlowZealotTableView.estimatedRowHeight = 0;
    self.laughGlowZealotTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.laughGlowZealotTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
    self.laughGlowZealotTableView.delegate = self;
    self.laughGlowZealotTableView.dataSource = self;
    self.laughGlowZealotTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.laughGlowZealotTableView.showsVerticalScrollIndicator = NO;
    self.laughGlowZealotTableView.showsHorizontalScrollIndicator = NO;
    self.laughGlowZealotTableView.backgroundColor = UIColor.clearColor;
    [self.laughGlowZealotTableView registerClass:[JuggleAmazingCell class] forCellReuseIdentifier:NSStringFromClass([JuggleAmazingCell class])];
    [self.view addSubview:self.laughGlowZealotTableView];
    [self.laughGlowZealotTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.equalTo(self.view);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    }];
}

//: 懒加载数据模型数组
- (NSMutableArray *)velvetGratitudeEchoModels {
	if (!_velvetGratitudeEchoModels) {
		_velvetGratitudeEchoModels = [NSMutableArray array];
	}
	return _velvetGratitudeEchoModels;
}

//: 获取数据模型
- (void)zealTerrainImaginationgetData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.velvetGratitudeEchoModels.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    JuggleAmazingCell *quirkOracleBlossom = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([JuggleAmazingCell class])];
    if (quirkOracleBlossom == nil) {
        quirkOracleBlossom = [[JuggleAmazingCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([JuggleAmazingCell class])];
    }
    quirkOracleBlossom.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return quirkOracleBlossom;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	JuggleAmazingModel *flowLuminescence = self.velvetGratitudeEchoModels[indexPath.row];
	return flowLuminescence.nostalgiaCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
